<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
      box-sizing: border-box;
    }

    ul {
      list-style: none;
    }

    .cls {
      color: orange;
    }
  </style>
</head>

<body>
  <div id="app">
    <czid :list="list">
      <template slot-scope="slotprops">
        <strong v-if="slotprops.info.id==2" class="cls">
          {{slotprops.info.name}}
        </strong>
      </template>
    </czid>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const czid = {
      "props": ["list"],
      data() {
        return {}
      },
      "methods": {},
      "template": `<div>
        <ul>
          <li v-for="(items,index) in list" :key="items.id">
            <slot :info="items">
              {{items.name}}
            </slot>
          </li>
        </ul>
      </div>`
    };
    const vm = new Vue({
      "el": "#app",
      "data": {
        "list": [{
          "id": 1,
          "name": "大家好"
        }, {
          "id": 2,
          "name": "你们好"
        }, {
          "id": 3,
          "name": "我不好"
        }, {
          "id": 4,
          "name": "他最好"
        }]
      },
      mounted() {},
      updated() {},
      "methods": {},
      "directives": {},
      "computed": {},
      "watch": {},
      "filters": {},
      "components": {
        czid
      }
    });
  </script>
</body>

</html>